<?php
namespace app\common\validate\agent;
use think\Validate;
/**
 * 推广员银行卡管理验证器
 */
class PromotionAccountValidate extends Validate
{
    // 验证规则
    protected $rule = [
        'ids' => ['require', 'array'],
        'id' => 'require',
        'is_disable' => ['require', 'in' => '0,1'],
        'type' => ['require', 'in' => '1,2'],
        'name' => 'require',
        'bank' => 'require',
        'bank_branch' => 'require',
        'card_no' => 'require',
        'alipay_account' => 'require',
    ];
    // 错误信息
    protected $message = [
        'type.require' => '请选择账户',
        'name.require' => '请输入姓名',
        'bank.require' => '请输入开户银行',
        'bank_branch.require' => '请输入开户支行',
        'card_no.require' => '请输入银行卡号',
        'alipay_account.require' => '请输入支付宝账号',
    ];
    // 验证场景
    protected $scene = [
        'info'    =>  ['id'],
        'add1'     =>  ['type','name','bank','bank_branch','card_no'],
        'add2'     =>  ['type','alipay_account'],
        'edit1'     =>  ['id','type','name','bank','bank_branch','card_no'],
        'edit2'     =>  ['id','type','alipay_account'],
        'dele'    =>  ['ids'],
        'disable' =>  ['ids', 'is_disable'],
    ];
}
